package com.zxm.web.controller;

import com.zxm.common.annotation.ApiVersion;
import com.zxm.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author silencezheng
 * @date 2023/2/9 10:18
 */
@RestController
@RequestMapping("api/{v}/user")
public class ApiVersionTestController {

    @RequestMapping("get")
    public AjaxResult getUser() {
        return AjaxResult.success("1");
    }

    @ApiVersion("1.0.0")
    @RequestMapping("get")
    public AjaxResult getUserV1() {
        return AjaxResult.success("2");
    }

    @ApiVersion("1.1.0")
    @RequestMapping("get")
    public AjaxResult getUserV11() {
        return AjaxResult.success("3");
    }

    @ApiVersion("1.1.2")
    @RequestMapping("get")
    public AjaxResult getUserV112() {
        return AjaxResult.success("4");
    }
}